using ASP;
using HoWave.Common;
using HoWave.Data;
using HoWave.Data.Bll;
using HoWave.Data.Model;
using HoWave.Web;
using HoWave.Web.Shop.Member;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class Member_Shop_AddOrderSend : Member, IRequiresSessionState
{
	protected ScriptManager smOrderSend;
	protected Literal SendGoodTitle;
	protected Literal LabCusName;
	protected HtmlTableRow tr_CusName;
	protected Literal LabConnetionName;
	protected HtmlTableRow tr_Receiver;
	protected Literal ltrReturn_UserName;
	protected HtmlTableRow trReturn_UserName;
	protected TextBox txtReturn_Receiver;
	protected HtmlTableRow trReturn_Receiver;
	protected Shop_UserControls_HowaveProvinceCity ddlReturn_ProvinceCityArea;
	protected HtmlTableRow trReturn_ProvinceCityArea;
	protected TextBox txtReturn_Address;
	protected HtmlTableRow trReturn_Address;
	protected DropDownList ddlReturn_DeliverSentType;
	protected Label LabDeliverType;
	protected Label DeliverSent_TiShi;
	protected Literal LabOrderFormNum;
	protected Label LabTotalMoney;
	protected Label LabPayedMoney;
	protected Literal ltrDeliverDate;
	protected HtmlInputText DeliverDate;
	protected HtmlInputText ExpressCompany;
	protected RequiredFieldValidator RequiredFieldValidator1;
	protected HtmlInputText ExpressNum;
	protected RequiredFieldValidator RequiredFieldValidator2;
	protected HtmlInputText HandlerName;
	protected RequiredFieldValidator RequiredFieldValidator3;
	protected TextBox Remark;
	protected CheckBox CheckSendMobileMesToCus;
	protected CheckBox CheckSendMesMesToCus;
	protected CheckBox CheckSendEmailMesToCus;
	protected Label LabMessage;
	protected Button Button1;
	protected Button Button2;
	protected HiddenField H_OrderFormID;
	protected HiddenField HiddenUserID;
	protected HiddenField HiddenSalerID;
	protected HiddenField HFUserGroupId;
	protected HiddenField HFCouponitemID;
	protected HiddenField HFUserEmail;
	protected HiddenField HFMobilePhone;
	protected HiddenField HFSalerName;
	protected HiddenField HFTradeType;
	protected HiddenField HFPresentExpTotal;
	private string userName = "";
	private string _SalerName = "";
	private string _OrderFormNum = "";
	private string _SalerEmail = "";
	private int _deliverType = -1;
	private string Msg;
	private DataTable _DTOrder;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	public string UserName
	{
		get
		{
			return this.userName;
		}
		set
		{
			this.userName = value;
		}
	}
	public string SalerName
	{
		get
		{
			return this._SalerName;
		}
		set
		{
			this._SalerName = value;
		}
	}
	public string OrderFormNum
	{
		get
		{
			if (Fetch.Get("OrderFormNum") != null)
			{
				this._OrderFormNum = Fetch.Get("OrderFormNum");
			}
			return this._OrderFormNum;
		}
		set
		{
			this._OrderFormNum = value;
		}
	}
	public string SalerEmail
	{
		get
		{
			return this._SalerEmail;
		}
		set
		{
			this._SalerEmail = value;
		}
	}
	public int DeliverType
	{
		get
		{
			if (Fetch.Get("DeliverType") != null)
			{
				this._deliverType = int.Parse(Fetch.Get("DeliverType"));
			}
			return this._deliverType;
		}
		set
		{
			this._deliverType = value;
		}
	}
	public DataTable DTOrder
	{
		get
		{
			return this._DTOrder;
		}
		set
		{
			this._DTOrder = value;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			if (string.IsNullOrEmpty(this.OrderFormNum))
			{
				this.WriteErrMsg("", Language.GetMemberMsg("Common/NotData", new string[0]), "");
			}
			Shop_Order shop_Order = new Shop_Order(this.conn);
			this.DTOrder = shop_Order.GetOrderInfo(this.OrderFormNum);
			if (this.DTOrder.Rows.Count <= 0)
			{
				this.WriteErrMsg("", Language.GetMemberMsg("Common/NotData", new string[0]), "");
			}
			this.SalerName = this.DTOrder.Rows[0]["SalerName"].ToString();
			this.HFSalerName.Value = this.DTOrder.Rows[0]["SalerName"].ToString();
			this.UserName = this.DTOrder.Rows[0]["BuyerName"].ToString();
			this.DeliverDate.Value = DateTime.Now.ToShortDateString();
			int num = int.Parse(this.DTOrder.Rows[0]["OrderFormID"].ToString());
			this.H_OrderFormID.Value = num.ToString();
			int userID = int.Parse(this.DTOrder.Rows[0]["UserID"].ToString());
			this.HiddenUserID.Value = userID.ToString();
			int userID2 = int.Parse(this.DTOrder.Rows[0]["SalerID"].ToString());
			this.HiddenSalerID.Value = userID2.ToString();
			this.LabOrderFormNum.Text = this.DTOrder.Rows[0]["OrderFormNum"].ToString();
			this.LabPayedMoney.Text = this.DTOrder.Rows[0]["MoneyReceipt"].ToString();
			this.LabTotalMoney.Text = this.DTOrder.Rows[0]["MoneyTotal"].ToString();
			string text = this.DTOrder.Rows[0]["ContacterName"].ToString();
			string text2 = this.DTOrder.Rows[0]["Email"].ToString();
			string text3 = this.DTOrder.Rows[0]["DeliverTypeName"].ToString();
			this.HFCouponitemID.Value = this.DTOrder.Rows[0]["CouponItemID"].ToString();
			this.HFTradeType.Value = this.DTOrder.Rows[0]["TradeType"].ToString();
			this.HFPresentExpTotal.Value = this.DTOrder.Rows[0]["PresentExpTotal"].ToString();
			string text4 = this.DTOrder.Rows[0]["PayStatus"].ToString();
			UserBll userBll = new UserBll(this.conn);
			UserInfoBll userInfoBll = new UserInfoBll(this.conn);
			DataTable userByUserID = userBll.GetUserByUserID(userID);
			DataTable userByUserID2 = userBll.GetUserByUserID(userID2);
			DataTable userInfoByUserID = userInfoBll.GetUserInfoByUserID(userID);
			DataTable userInfoByUserID2 = userInfoBll.GetUserInfoByUserID(userID2);
			string text5 = userInfoByUserID.Rows[0]["TrueName"].ToString();
			string value = userByUserID.Rows[0]["Email"].ToString();
			this.HFUserEmail.Value = value;
			string text6 = userInfoByUserID2.Rows[0]["TrueName"].ToString();
			this.HFMobilePhone.Value = userInfoByUserID.Rows[0]["MobilePhone"].ToString();
			this.UserName = userByUserID.Rows[0]["UserName"].ToString();
			this.HFUserGroupId.Value = userByUserID.Rows[0]["GroupID"].ToString();
			this.SalerName = userByUserID2.Rows[0]["UserName"].ToString();
			this.SalerEmail = userByUserID2.Rows[0]["Email"].ToString();
			int num2 = 0;
			if (userByUserID2.Columns.Contains("ShopID"))
			{
				if (userByUserID2.Rows[0]["ShopID"] != DBNull.Value)
				{
					num2 = userByUserID2.Rows[0]["ShopID"].ToInt32(new int[0]);
				}
			}
			userByUserID.Dispose();
			userByUserID2.Dispose();
			userInfoByUserID.Dispose();
			userInfoByUserID2.Dispose();
			if (this.DeliverType == 0)
			{
				if (userID2.ToString() != base.user.UserID.ToString())
				{
					this.WriteErrMsg("", Language.GetMemberMsg("Common/NotData", new string[0]), "");
				}
				if (text4.Trim() == "0")
				{
					this.WriteErrMsg("", "未付款不能发货！", "");
				}
			}
			else
			{
				if (this.DeliverType == 1)
				{
					if (userID.ToString() != base.user.UserID.ToString())
					{
						this.WriteErrMsg("", Language.GetMemberMsg("Common/NotData", new string[0]), "");
					}
				}
			}
			if (this.DeliverType == 0)
			{
				this.SendGoodTitle.Text = "录 入 发 货 信 息";
				this.tr_CusName.Visible = true;
				this.tr_Receiver.Visible = true;
				this.trReturn_UserName.Visible = false;
				this.trReturn_Receiver.Visible = false;
				this.trReturn_ProvinceCityArea.Visible = false;
				this.trReturn_Address.Visible = false;
				this.LabCusName.Text = text5;
				this.LabConnetionName.Text = text;
				this.LabDeliverType.Text = text3;
				this.DeliverSent_TiShi.Text = "(客户指定的送货方式)";
				this.ddlReturn_DeliverSentType.Visible = false;
				this.ltrDeliverDate.Text = "发货日期：";
				this.HandlerName.Value = text6;
			}
			else
			{
				if (this.DeliverType == 1)
				{
					this.SendGoodTitle.Text = "录 入 退 货 信 息";
					this.tr_CusName.Visible = false;
					this.tr_Receiver.Visible = false;
					this.trReturn_UserName.Visible = true;
					this.trReturn_Receiver.Visible = true;
					this.trReturn_ProvinceCityArea.Visible = true;
					this.trReturn_Address.Visible = true;
					this.ltrReturn_UserName.Text = text5;
					this.txtReturn_Receiver.Text = text6;
					this.DeliverSent_TiShi.Text = "(选择退货的送货方式)";
					this.LabDeliverType.Visible = false;
					this.ltrDeliverDate.Text = "退货日期：";
					this.HandlerName.Value = text5;
					if (num2 > 0)
					{
						string sql = "select * from HLShop_Shop where ShopID=" + num2;
						DataTable dataTable = this.conn.GetDataTable(sql);
						if (dataTable != null)
						{
							if (dataTable.Rows.Count > 0)
							{
								DataRow dataRow = dataTable.Rows[0];
								string selectedProvince = "";
								string selectedCity = "";
								string selectedArea = "";
								string text7 = "";
								if (dataRow["Province"] != DBNull.Value)
								{
									selectedProvince = dataRow["Province"].ToString();
								}
								if (dataRow["City"] != DBNull.Value)
								{
									selectedCity = dataRow["City"].ToString();
								}
								if (dataRow["Area"] != DBNull.Value)
								{
									selectedArea = dataRow["Area"].ToString();
								}
								if (dataRow["ShopAddress"] != DBNull.Value)
								{
									text7 = dataRow["ShopAddress"].ToString();
								}
								this.ddlReturn_ProvinceCityArea.SelectedProvince = selectedProvince;
								this.ddlReturn_ProvinceCityArea.SelectedCity = selectedCity;
								this.ddlReturn_ProvinceCityArea.SelectedArea = selectedArea;
								this.txtReturn_Address.Text = text7;
							}
						}
					}
				}
			}
		}
	}
	private bool CheckInput()
	{
		bool result = true;
		if (!string.IsNullOrEmpty(this.DeliverDate.Value))
		{
			DateTime now = DateTime.Now;
			DateTime d = Convert.ToDateTime(this.DeliverDate.Value.Trim());
			int days = (d - now).Days;
			if (days < 0)
			{
				MessageBox.Show(this, "时间不能小于当前时间！");
				this.DeliverDate.Focus();
				result = false;
			}
		}
		else
		{
			MessageBox.Show(this, "时间不能为空！");
			this.DeliverDate.Focus();
			result = false;
		}
		if (this.DeliverType == 1)
		{
			string text = this.txtReturn_Receiver.Text;
			if (string.IsNullOrEmpty(text))
			{
				MessageBox.Show(this, "收件人不能为空！");
				result = false;
			}
			string selectedProvince = this.ddlReturn_ProvinceCityArea.SelectedProvince;
			if (string.IsNullOrEmpty(selectedProvince))
			{
				MessageBox.Show(this, "地址不能为空！");
				result = false;
			}
			string text2 = this.txtReturn_Address.Text;
			if (string.IsNullOrEmpty(text2))
			{
				MessageBox.Show(this, "详细地址不能为空！");
				result = false;
			}
		}
		return result;
	}
	protected void Button1_Click(object sender, EventArgs e)
	{
		Shop_DeliverItem shop_DeliverItem = new Shop_DeliverItem(this.conn);
		Shop_Order shop_Order = new Shop_Order(this.conn);
		if (this.CheckInput())
		{
			if (this.DeliverType == 0)
			{
				DataTable dataTable = this.conn.GetDataTable("select * from HLShop_OrderItem where OrderFormNum='" + this.OrderFormNum + "'");
				if (dataTable != null && dataTable.Rows.Count > 0)
				{
					for (int i = 0; i < dataTable.Rows.Count; i++)
					{
						int num = int.Parse(dataTable.Rows[i]["ProductID"].ToString());
						DataTable dataTable2 = this.conn.GetDataTable("select Stocks,ProductName,ProductType from HLShop_Product where ProductID=" + num);
						int num2 = int.Parse(dataTable2.Rows[0]["Stocks"].ToString());
						string str = dataTable2.Rows[0]["ProductName"].ToString();
						int num3 = dataTable2.Rows[0]["ProductType"].ToString().ToInt32(new int[0]);
						dataTable2.Dispose();
						DataTable dataTable3 = this.conn.GetDataTable(string.Concat(new object[]
						{
							"select sum(Quantity) as Quantity from HLShop_OrderItem where OrderFormNum='",
							this.OrderFormNum,
							"' and ProductID=",
							num
						}));
						int num4 = int.Parse(dataTable3.Rows[0]["Quantity"].ToString());
						dataTable3.Dispose();
						if (num3 != 4 && num3 != 5)
						{
							if (num4 > num2)
							{
								this.Page.ClientScript.RegisterStartupScript(base.GetType(), "Test", "<script>alert('" + str + "商品已超过库存量!');</script>");
								return;
							}
						}
					}
				}
			}
			bool flag = false;
			int num5 = int.Parse(this.H_OrderFormID.Value);
			DateTime deliverDate = DateTime.Parse(this.DeliverDate.Value);
			string value = this.ExpressCompany.Value;
			string value2 = this.ExpressNum.Value;
			string value3 = this.HandlerName.Value;
			string text = this.Remark.Text;
			if (this.DeliverType == 0)
			{
				string sql = "select * from HLShop_DeliverItem  where OrderID=" + num5 + " and DeliverType=0";
				DataTable dataTable4 = this.conn.GetDataTable(sql);
				if (dataTable4 != null)
				{
					if (dataTable4.Rows.Count > 0)
					{
						this.WriteErrMsg("", "商品已发货！", "Shop_BuyOrder.aspx?OrderFormNum=" + this.OrderFormNum);
					}
				}
				int inputerID = Convert.ToInt32(this.HiddenSalerID.Value);
				flag = shop_DeliverItem.AddDeliverItem(Convert.ToInt32(this.HiddenUserID.Value), inputerID, num5, this.DeliverType, this.LabDeliverType.Text, deliverDate, value2, value, value3, text);
				if (flag)
				{
					string text2 = "";
					DataTable dataTable5 = this.conn.GetDataTable("select * from HLShop_OrderItem where OrderFormNum='" + this.OrderFormNum + "'");
					if (dataTable5 != null && dataTable5.Rows.Count > 0)
					{
						for (int i = 0; i < dataTable5.Rows.Count; i++)
						{
							string s = dataTable5.Rows[i]["ProductID"].ToString();
							int num6 = int.Parse(s);
							int num7 = int.Parse(dataTable5.Rows[i]["Quantity"].ToString());
							string text3 = "";
							string text4 = "select BidTimes from HLShop_Product where ProductID=" + num6;
							DataTable productByProductID = Shop_Product.instance.GetProductByProductID(num6);
							if (productByProductID.Rows.Count > 0)
							{
								if (productByProductID.Columns.Contains("BidTimes"))
								{
									if (productByProductID.Rows[0]["BidTimes"] != DBNull.Value)
									{
										text3 = ",BidTimes=BidTimes+1";
									}
									else
									{
										text3 = ",BidTimes=1";
									}
								}
							}
							string text5 = "ProductType<>4 and ProductType<>5 ";
							this.conn.Execute(string.Concat(new object[]
							{
								"update HLShop_Product set BuyTimes=BuyTimes+1,Stocks=Stocks-",
								num7,
								text3,
								" where ",
								text5,
								" and ProductID=",
								num6
							}));
							string text6 = base.UserGetCouponInfoIDStr(num6, "get", this.HFUserGroupId.Value);
							if (!string.IsNullOrEmpty(text6))
							{
								text2 = text2 + text6 + ",";
							}
						}
					}
					if (!string.IsNullOrEmpty(this.HiddenSalerID.Value))
					{
						if (base.OwnerPromotionPower(Convert.ToInt32(this.HiddenSalerID.Value)))
						{
							if (text2 != "")
							{
								text2 = text2.Substring(0, text2.Length - 1);
								decimal d = 0m;
								if (!string.IsNullOrEmpty(this.HFCouponitemID.Value))
								{
									DataTable listByItemID = BLLInstance.BllCouponItem.GetListByItemID(this.HFCouponitemID.Value);
									if (listByItemID.Rows.Count > 0)
									{
										d = Convert.ToDecimal(listByItemID.Rows[0]["CouponParvalue"].ToString());
									}
								}
								decimal orderMoney = Convert.ToDecimal(this.LabTotalMoney.Text) + d;
								int num8 = base.UserGetCouponMethod(Convert.ToInt32(this.H_OrderFormID.Value), this.UserName, "get", orderMoney, text2);
								if (num8 > 0)
								{
									this.SendCouponMessage(num8, "得到优惠券通知", "得到", this.OrderFormNum);
								}
							}
						}
					}
					shop_Order.updateStatus(this.OrderFormNum, "", "1", "");
					this.UpdateStockStatus();
					this.SendMsg();
				}
			}
			else
			{
				if (this.DeliverType == 1)
				{
					int inputerID = this.HiddenUserID.Value.ToInt32(new int[0]);
					int userID = Convert.ToInt32(this.HiddenSalerID.Value);
					string deliverName = "";
					if (this.ddlReturn_DeliverSentType.Items.Count > 0)
					{
						deliverName = this.ddlReturn_DeliverSentType.GetSelectValue(new string[0]);
					}
					string text7 = this.txtReturn_Receiver.Text;
					string selectedProvince = this.ddlReturn_ProvinceCityArea.SelectedProvince;
					string selectedCity = this.ddlReturn_ProvinceCityArea.SelectedCity;
					string selectedArea = this.ddlReturn_ProvinceCityArea.SelectedArea;
					string text8 = this.txtReturn_Address.Text;
					string r_ZipCode = "";
					string r_TelPhone = "";
					string r_MobilePhone = "";
					string r_Email = "";
					string r_OwnerUser = "saler";
					flag = shop_DeliverItem.AddDeliverItemTransaction(userID, inputerID, num5, this.DeliverType, deliverName, deliverDate, value2, value, value3, text, text7, selectedProvince, selectedCity, selectedArea, text8, r_ZipCode, r_TelPhone, r_MobilePhone, r_Email, r_OwnerUser);
					if (flag)
					{
						this.SendReturnMsg();
					}
				}
			}
			if (flag)
			{
				this.Msg += Language.Get("Common/Success");
				this.WriteSuccessMsg("", this.Msg, "Shop_BuyOrder.aspx?OrderFormNum=" + this.OrderFormNum);
			}
			else
			{
				this.WriteErrMsg("", Language.Get("Common/Fail", ""), "");
			}
		}
	}
	private void UpdateStockStatus()
	{
		if (!string.IsNullOrEmpty(this.H_OrderFormID.Value))
		{
			DataTable dataTable = BLLInstance.BllStockInfoOrder.GetList("OrderID=" + this.H_OrderFormID.Value).Tables[0];
			for (int i = 0; i < dataTable.Rows.Count; i++)
			{
				int infoOrderID = Convert.ToInt32(dataTable.Rows[i]["InfoOrderID"].ToString());
				HoWave.Data.Model.StockInfoOrder model = BLLInstance.BllStockInfoOrder.GetModel(infoOrderID);
				if (model != null)
				{
					model.InfoOrderID = infoOrderID;
					model.StockStatus = new int?(3);
					model.StockDate = new DateTime?(DateTime.Now);
					BLLInstance.BllStockInfoOrder.Update(model);
				}
			}
		}
	}
	private void SendCouponMessage(int getCouponItemID, string sendTitle, string msgContent, string ordernumber)
	{
		if (!string.IsNullOrEmpty(this.HFCouponitemID.Value))
		{
			HoWave.Data.Model.CouponItem model = BLLInstance.BllCouponItem.GetModel(getCouponItemID);
			if (model != null)
			{
				string smtpserver = this.config["MailSmtpServer"].ToString();
				string mailuser = this.config["MailServerUserName"].ToString();
				string mailpassword = this.config["MailServerPassWord"].ToString();
				string mailFrom = this.config["MailServerFrom"].ToString();
				string text = string.Concat(new string[]
				{
					this.UserName,
					"您好：您已经在订单号为",
					ordernumber,
					"，",
					msgContent,
					"编号为",
					model.CouponNum,
					"的优惠劵。"
				});
				model.MessageStatus = true;
				string value = this.HFSalerName.Value;
				MessageBll messageBll = new MessageBll(this.conn);
				bool flag = messageBll.AddMessage(value, "Users", sendTitle, text, 0, 0, 1, 0, this.UserName, "", 1);
				if (!string.IsNullOrEmpty(base.user.UserEmail))
				{
					string value2 = this.HFUserEmail.Value;
					model.EmailStatus = true;
					Email email = new Email();
					bool flag2 = email.SendEmail(smtpserver, mailuser, mailpassword, mailFrom, text, value2, sendTitle);
				}
				string value3 = this.HFMobilePhone.Value;
				if (!string.IsNullOrEmpty(value3))
				{
					model.MobileStatus = true;
					MobileMessage mobileMessage = new MobileMessage();
					bool flag3 = mobileMessage.Send(value3, text, this.UserName);
				}
				model.CouponItemID = getCouponItemID;
				BLLInstance.BllCouponItem.Update(model);
			}
		}
	}
	protected void SendMsg()
	{
		string text = this.UserName;
		string text2 = "发货通知";
		string text3 = this.config["MessageOfDeliver"].ToString();
		text3 = text3.Replace("{$UserName$}", text);
		text3 = text3.Replace("{$InputTime$}", DateTime.Now.ToString());
		text3 = text3.Replace("{$OrderFormNum$}", this.OrderFormNum);
		if (this.CheckSendMesMesToCus.Checked)
		{
			MessageBll messageBll = new MessageBll(this.conn);
			if (messageBll.AddMessage(this.SalerName, "Users", text2, text3, 0, 0, 1, 0, text, "", 1))
			{
				this.Msg = this.Msg + "<br/>" + Language.GetMemberMsg("Order/Notice/MessageSuccess", new string[0]);
			}
		}
		if (this.CheckSendEmailMesToCus.Checked)
		{
			string text4 = this.config["SiteName"].ToString();
			string smtpserver = this.config["MailSmtpServer"].ToString();
			string mailuser = this.config["MailServerUserName"].ToString();
			string mailpassword = this.config["MailServerPassWord"].ToString();
			string mailFrom = this.config["MailServerFrom"].ToString();
			Email email = new Email();
			try
			{
				if (email.SendEmail(smtpserver, mailuser, mailpassword, mailFrom, text3, this.HFUserEmail.Value, text2))
				{
					this.Msg = this.Msg + "<br/>" + Language.GetMemberMsg("Order/Notice/EmailSuccess", new string[0]);
				}
			}
			catch
			{
			}
		}
		if (this.CheckSendMobileMesToCus.Checked)
		{
			if (this.DTOrder.Rows[0]["Mobile"] != null)
			{
				string receiveNumber = this.DTOrder.Rows[0]["Mobile"].ToString();
				MobileMessage mobileMessage = new MobileMessage();
				if (mobileMessage.Send(receiveNumber, text3, this.UserName))
				{
					this.Msg = this.Msg + "<br/>" + Language.GetMemberMsg("Order/Notice/MobileSuccess", new string[0]);
				}
			}
		}
	}
	public void SendReturnMsg()
	{
		string sender = this.UserName;
		string title = "退货通知";
		string text = this.config["MessageReturnGoods"].ToString();
		text = text.Replace("{$UserName$}", this.SalerName);
		text = text.Replace("{$InputTime$}", DateTime.Now.ToString());
		text = text.Replace("{$OrderFormNum$}", this.OrderFormNum);
		if (this.CheckSendMesMesToCus.Checked)
		{
			MessageBll messageBll = new MessageBll(this.conn);
			if (messageBll.AddMessage(sender, "Users", title, text, 0, 0, 1, 0, this.SalerName, "", 1))
			{
				this.Msg = this.Msg + "<br/>" + Language.GetMemberMsg("Order/Notice/MessageSuccess", new string[0]);
			}
		}
	}
}
